﻿using System.IO;
namespace ResourceReportBuilder
{
    public class WebResource
    {
        public string Path { get; private set; }
        public string MimeType { get; set; }
        public string Size { get; private set; }
        public bool PerformSubstitution { get; set; }
        public string ID { get; set; }
        public string Type { get; set; }

        public WebResource(string path)
        {
            Path = path;
            Size = Common.Utils.FormatBytes(new FileInfo(path).Length);
            MimeType type = Utils.GetMimeTypeLocal(path);
            MimeType = type.Type;
            ID = type.ID;

            PerformSubstitution = type.PerformSubstitution;
        }
    }
}
